package com.bwie.service.impl;

import com.bwie.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.mapper.OrderMapper;
import com.bwie.domain.Order;
import com.bwie.service.OrderService;
import org.springframework.transaction.annotation.Transactional;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService{

    @Autowired
    private OrderMapper orderMapper;
    @Override
    public R getOrderList() {
        List<Order> orderList = orderMapper.selectList(null);
        log.info("orderList{}:",orderList);
        return R.OK(orderList);
    }

    @Override
    public R deleteOrder(Long id) {
        orderMapper.deleteById(id);
        return R.OK();
    }
}
